1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */
2/* $FreeBSD: head/sys/net/if_gre.c 154625 2006-01-21 10:44:34Z bz $ */
3
4/*-
5 * Copyright (c) 1998 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Heiko W.Rupp <hwr@pilhuhn.de>
10 *
--- 596 unchanged lines hidden (view full) ---
607 error = EAFNOSUPPORT;
608 break;
609 }
610 if (lifr->addr.ss_len != sizeof(si) ||
611 lifr->dstaddr.ss_len != sizeof(si)) {
612 error = EINVAL;
613 break;
614 }
615 sc->g_src = (satosin((struct sockadrr *)&lifr->addr))->sin_addr;
616 sc->g_dst =
617 (satosin((struct sockadrr *)&lifr->dstaddr))->sin_addr;
618 goto recompute;
619 case SIOCDIFPHYADDR:
620 if ((error = suser(curthread)) != 0)
621 break;
622 sc->g_src.s_addr = INADDR_ANY;
623 sc->g_dst.s_addr = INADDR_ANY;
624 goto recompute;
625 case SIOCGLIFPHYADDR:
--- 182 unchanged lines hidden ---
2/* $FreeBSD: head/sys/net/if_gre.c 154625 2006-01-21 10:44:34Z bz $ */
3
4/*-
5 * Copyright (c) 1998 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Heiko W.Rupp <hwr@pilhuhn.de>
10 *
--- 596 unchanged lines hidden (view full) ---
607 error = EAFNOSUPPORT;
608 break;
609 }
610 if (lifr->addr.ss_len != sizeof(si) ||
611 lifr->dstaddr.ss_len != sizeof(si)) {
612 error = EINVAL;
613 break;
614 }
615 sc->g_src = (satosin((struct sockadrr *)&lifr->addr))->sin_addr;
616 sc->g_dst =
617 (satosin((struct sockadrr *)&lifr->dstaddr))->sin_addr;
618 goto recompute;
619 case SIOCDIFPHYADDR:
620 if ((error = suser(curthread)) != 0)
621 break;
622 sc->g_src.s_addr = INADDR_ANY;
623 sc->g_dst.s_addr = INADDR_ANY;
624 goto recompute;
625 case SIOCGLIFPHYADDR:
--- 182 unchanged lines hidden ---