]> git.proxmox.com Git - mirror_iproute2.git/commit
utils: Always specify family and ->bytelen in get_prefix_1()
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 18 Jan 2018 18:13:43 +0000 (20:13 +0200)
committerDavid Ahern <dsahern@gmail.com>
Sun, 21 Jan 2018 17:38:19 +0000 (09:38 -0800)
commit93fa12418dc6f5943692250244be303bb162175b
treecb23f585cb483bfd4129617455925faeb3e133c9
parentf2522007d8fee924cb098b4afc8af16f2b25829f
utils: Always specify family and ->bytelen in get_prefix_1()

Handle default/all/any special case in get_addr_1() to setup
->family and ->bytelen correctly.

Make get_addr_1() return ->bitlen == -2 instead of -1 to
distinguish default/all/any special case from the rest:
it is safe because all callers check ->bitlen < 0, not
explicit value -1.

Reduce intendation by one level and get rid of goto/label
to make code more readable.

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
lib/utils.c