Scapy has this code:

```
    def post_build(self, p, pay):
        p += pay
        if self.chksum is None:
            ck = checksum(p)
            p = p[:2]+chr(ck>>8)+chr(ck&0xff)+p[4:]
        return p
```

I tested it in the scapy shell and it at least produces different checksums for different payloads.