if_tun.c (20407) | if_tun.c (20559) |
---|---|
1/* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */ 2 3/* 4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> 5 * Nottingham University 1987. 6 * 7 * This source may be freely distributed, however I would be interested 8 * in any changes that are made. --- 254 unchanged lines hidden (view full) --- 263 TUNDEBUG("%s%d: address set\n", 264 ifp->if_name, ifp->if_unit); 265 break; 266 case SIOCSIFDSTADDR: 267 tuninit(ifp->if_unit); 268 TUNDEBUG("%s%d: destination address set\n", 269 ifp->if_name, ifp->if_unit); 270 break; | 1/* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */ 2 3/* 4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> 5 * Nottingham University 1987. 6 * 7 * This source may be freely distributed, however I would be interested 8 * in any changes that are made. --- 254 unchanged lines hidden (view full) --- 263 TUNDEBUG("%s%d: address set\n", 264 ifp->if_name, ifp->if_unit); 265 break; 266 case SIOCSIFDSTADDR: 267 tuninit(ifp->if_unit); 268 TUNDEBUG("%s%d: destination address set\n", 269 ifp->if_name, ifp->if_unit); 270 break; |
271 case SIOCSIFMTU: 272 ifp->if_mtu = ifr->ifr_mtu; 273 TUNDEBUG("%s%d: mtu set\n", 274 ifp->if_name, ifp->if_unit); 275 break; |
|
271 case SIOCADDMULTI: 272 case SIOCDELMULTI: 273 if (ifr == 0) { 274 error = EAFNOSUPPORT; /* XXX */ 275 break; 276 } 277 switch (ifr->ifr_addr.sa_family) { 278 --- 235 unchanged lines hidden (view full) --- 514{ 515 int unit = minor (dev); 516 struct ifnet *ifp = &tunctl[unit].tun_if; 517 struct mbuf *top, **mp, *m; 518 int error=0, s, tlen, mlen; 519 520 TUNDEBUG("%s%d: tunwrite\n", ifp->if_name, ifp->if_unit); 521 | 276 case SIOCADDMULTI: 277 case SIOCDELMULTI: 278 if (ifr == 0) { 279 error = EAFNOSUPPORT; /* XXX */ 280 break; 281 } 282 switch (ifr->ifr_addr.sa_family) { 283 --- 235 unchanged lines hidden (view full) --- 519{ 520 int unit = minor (dev); 521 struct ifnet *ifp = &tunctl[unit].tun_if; 522 struct mbuf *top, **mp, *m; 523 int error=0, s, tlen, mlen; 524 525 TUNDEBUG("%s%d: tunwrite\n", ifp->if_name, ifp->if_unit); 526 |
522 if (uio->uio_resid < 0 || uio->uio_resid > TUNMTU) { | 527 if (uio->uio_resid < 0 || uio->uio_resid > ifp->if_mtu) { |
523 TUNDEBUG("%s%d: len=%d!\n", ifp->if_name, ifp->if_unit, 524 uio->uio_resid); 525 return EIO; 526 } 527 tlen = uio->uio_resid; 528 529 /* get a header mbuf */ 530 MGETHDR(m, M_DONTWAIT, MT_DATA); --- 101 unchanged lines hidden --- | 528 TUNDEBUG("%s%d: len=%d!\n", ifp->if_name, ifp->if_unit, 529 uio->uio_resid); 530 return EIO; 531 } 532 tlen = uio->uio_resid; 533 534 /* get a header mbuf */ 535 MGETHDR(m, M_DONTWAIT, MT_DATA); --- 101 unchanged lines hidden --- |