https://github.com/openshift/origin/pull/19099
This went out in 3.9.0.
Tested on 3.9.27, seems it still has problem. Copy the function from the egressip.go func main() { var vnid uint32 = 11223195 var masqueradeBit uint32 = 0 if vnid == 0 { vnid = 0xff000000 } if (vnid & masqueradeBit) != 0 { vnid = (vnid | 0x01000000) ^ masqueradeBit } fmt.Printf("%x\n", vnid) } The vnid of my project is 11223195, if the masqueradeBit set to 0, the output above should be ab409b, and if set the masqueradeBit to 14, the output above will be 1ab4095 Checking the openflow rules after the egressip configured. cookie=0x0,table=100, priority=100,ip,reg0=0xab409b actions=set_field:ba:ee:08:a6:0b:72->eth_dst,set_field:0x1ab409a->pkt_mark,goto_table:101 The pkt_mark is set as the value when the masqueradeBit = 14
The comment#3 should be wrong, as the masqueradeBit value is not 0, it should be 1 since the value comes from "1 << 0". As the result, the mark for the vnid with a even number will be the same as the vnid, and the mark for the vnid with odd number, it will add 1 bit to the beginning and minus 1 from the last bit. So the value is correct. the function should be changed to: func main() { var vnid uint32 = 11223195 var masqueradeBit uint32 = 1 << 0 if vnid == 0 { vnid = 0xff000000 } if (vnid & masqueradeBit) != 0 { vnid = (vnid | 0x01000000) ^ masqueradeBit } fmt.Printf("%x\n", vnid) } So with the VNID = 11223195, the correct output should be 1ab409a, and if the masqueradebit is 14, the value should be 1ab408b It is fixed actually.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:3748