[ovs-dev] bug in sflow_choose_agent_address()
Neil McKee
neil.mckee at inmon.com
Wed Sep 19 17:16:37 UTC 2018
It looks like the intent here was to get the local source-address
associated with the route to the sFlow target-address:
https://github.com/openvswitch/ovs/blob/master/ofproto/ofproto-dpif-sflow.c#L475-L481
That's a good idea, but the answer supplied by ovs_router_lookup() via
&src is ignored, so this code just sets the sFlow agent-address to
the sFlow target-address... with a high potential for turmoil :)
The suggested fix would be to introduce a new local var "struct
in6_addr target", offer &target to ovs_router_lookup(), and if the
lookup works then set ip = target before goto success. That way you
are never setting "ip" to a toxic value.
Sorry didn't notice this at the time.
The workaround is just to make sure that the agent-address is set in
the config and not left to automatic selection, which is probably
what most deployments do anyway. (e.g. running hsflowd with the ovs{}
module enabled will take care of it).
Neil
------
Neil McKee
InMon Corp.
http://www.inmon.com
More information about the dev
mailing list