Skip to content

Commit

Permalink
Fix another panic case of vishvananda#509.
Browse files Browse the repository at this point in the history
Signed-off-by: Dongdong Wang <wangdongdong.6@bytedance.com>
  • Loading branch information
Dongdong-Wang authored and tl committed Apr 5, 2022
1 parent b9bf300 commit 7c094a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions link_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2778,6 +2778,10 @@ func addIptunAttrs(iptun *Iptun, linkInfo *nl.RtAttr) {
func parseIptunData(link Link, data []syscall.NetlinkRouteAttr) {
iptun := link.(*Iptun)
for _, datum := range data {
// NOTE: same with vxlan, ip tunnel may also has null datum.Value
if len(datum.Value) == 0 {
continue
}
switch datum.Attr.Type {
case nl.IFLA_IPTUN_LOCAL:
iptun.Local = net.IP(datum.Value[0:4])
Expand Down

0 comments on commit 7c094a8

Please sign in to comment.