trafgen: l3: Support interface without IP address
commitc4e07d5142c8991d532804ff60b5cf16029c0497
authorKen Wu <abawwu@gmail.com>
Sun, 4 Dec 2016 16:39:36 +0000 (5 00:39 +0800)
committerTobias Klauser <tklauser@distanz.ch>
Mon, 5 Dec 2016 07:43:37 +0000 (5 08:43 +0100)
tree06f5acbe1802fca18153167bb964bf277b012638
parent630c65e6794d548f757d904948ef2a6dfd466abe
trafgen: l3: Support interface without IP address

Move default source address setting to packet_finish so that we do not
need to get the device's address if the source address is set in the
packet. Without this, trafgen does not work with an interface without
address configured. In addition, in the case failing to get the address
for an interface, intead of panic, it now prints a warning and uses a
value of 0.0.0.0.

Signed-off-by: Ken Wu <abawwu@gmail.com>
Reviewed-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
trafgen_l3.c
trafgen_proto.c