9121 dladm: addrval can be NULL, need to check in iptun_process_addrarg()

Review Request #917 — Created March 2, 2018 and submitted

domag02
illumos-gate
9121
general

9121 dladm: addrval can be NULL, need to check in iptun_process_addrarg()

From the illumos-joyent github bug #123:

While messing around with dladm:

# dladm create-iptun -T ipv4 -a local=172.16.12.10,remote tun0

Segmentation Fault (core dumped)

It's probably invalid syntax for the dladm command but it shouldn't segfault. Trace is:

   $C
   08047318 libc.so.1`strlen+0x30(804780d, 0, 401, fee2c574)
   08047368 iptun_process_addrarg+0x8d(8047de7, 8047400, 80473a8, feea4d82)
   080473a8 iptun_process_args+0x78(6, 8047cac, 80688d6, 8047400, 80473fc, 80473dc)
   08047c28 do_create_iptun+0x33(6)
   08047c68 main+0xb9(8047c5c, fef1a768, 8047c9c, 8056ac7, 7, 8047ca8)
   08047c9c _start+0x83(7, 8047db0, 8047db6, 8047dc3, 8047dc6, 8047dcb)

Built, installed, tested.

The Illumos Project     SunOS 5.11      master-0-g1cfad7ce45    Feb. 25, 2018
SunOS Internal Development: domag 2018-Feb-25 [illumos-gate-bug-9121_build]
root@openindiana:~# dladm create-iptun -t -a local=,remote test_iptun_01
dladm: tunnel destination address value is missing
root@openindiana:~# dladm create-iptun -t -a local,remote test_iptun_01
dladm: tunnel source address value is missing
root@openindiana:~# dladm create-iptun -T ipv4 -t -a local=127.0.0.1,remote test_iptun_01
dladm: tunnel destination address value is missing
root@openindiana:~# dladm create-iptun -T ipv4 -t -a local=127.0.0.1,remote= test_iptun_01
dladm: could not create tunnel: invalid argument
root@openindiana:~# dladm create-iptun -T ipv4 -t -a local=,remote= test_iptun_01
dladm: could not create tunnel: invalid argument
root@openindiana:~# 
Loading file attachments...

domag02
domag02
tsoome
  1. Ship It!
  2. 
      
andy_js
  1. Ship It!
  2. 
      
igork
  1. Ship It!
  2. 
      
domag02
domag02
Review request changed

Status: Closed (submitted)

Loading...