Deleted Added
full compact
ip_carp.c (147256) ip_carp.c (147611)
1/* $FreeBSD: head/sys/netinet/ip_carp.c 147256 2005-06-10 16:49:24Z brooks $ */
1/* $FreeBSD: head/sys/netinet/ip_carp.c 147611 2005-06-26 18:11:11Z dwmalone $ */
2
3/*
4 * Copyright (c) 2002 Michael Shalayeff. All rights reserved.
5 * Copyright (c) 2003 Ryan McBride. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 1905 unchanged lines hidden (view full) ---

1915
1916/*
1917 * XXX: this is looutput. We should eventually use it from there.
1918 */
1919static int
1920carp_looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
1921 struct rtentry *rt)
1922{
2
3/*
4 * Copyright (c) 2002 Michael Shalayeff. All rights reserved.
5 * Copyright (c) 2003 Ryan McBride. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 1905 unchanged lines hidden (view full) ---

1915
1916/*
1917 * XXX: this is looutput. We should eventually use it from there.
1918 */
1919static int
1920carp_looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
1921 struct rtentry *rt)
1922{
1923 u_int32_t af;
1924
1923 M_ASSERTPKTHDR(m); /* check if we have the packet header */
1924
1925 if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
1926 m_freem(m);
1927 return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
1928 rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
1929 }
1930
1931 ifp->if_opackets++;
1932 ifp->if_obytes += m->m_pkthdr.len;
1925 M_ASSERTPKTHDR(m); /* check if we have the packet header */
1926
1927 if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
1928 m_freem(m);
1929 return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
1930 rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
1931 }
1932
1933 ifp->if_opackets++;
1934 ifp->if_obytes += m->m_pkthdr.len;
1935
1936 /* BPF writes need to be handled specially. */
1937 if (dst->sa_family == AF_UNSPEC) {
1938 bcopy(dst->sa_data, &af, sizeof(af));
1939 dst->sa_family = af;
1940 }
1941
1933#if 1 /* XXX */
1934 switch (dst->sa_family) {
1935 case AF_INET:
1936 case AF_INET6:
1937 case AF_IPX:
1938 case AF_APPLETALK:
1939 break;
1940 default:

--- 210 unchanged lines hidden ---
1942#if 1 /* XXX */
1943 switch (dst->sa_family) {
1944 case AF_INET:
1945 case AF_INET6:
1946 case AF_IPX:
1947 case AF_APPLETALK:
1948 break;
1949 default:

--- 210 unchanged lines hidden ---