ip_output.c (2e77d270c1bcf6a24dc17a8b27e844f36a8ddd54) ip_output.c (f3e7afe2d7b262ab55ab818445d4dfdb6e0c70a9)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

28 *
29 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD$");
34
35#include "opt_inet.h"
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

28 *
29 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD$");
34
35#include "opt_inet.h"
36#include "opt_ratelimit.h"
36#include "opt_ipsec.h"
37#include "opt_mbuf_stress_test.h"
38#include "opt_mpath.h"
39#include "opt_route.h"
40#include "opt_sctp.h"
41#include "opt_rss.h"
42
43#include <sys/param.h>

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

656 m = m_fragment(m, M_NOWAIT, mbuf_frag_size);
657#endif
658 /*
659 * Reset layer specific mbuf flags
660 * to avoid confusing lower layers.
661 */
662 m_clrprotoflags(m);
663 IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL);
37#include "opt_ipsec.h"
38#include "opt_mbuf_stress_test.h"
39#include "opt_mpath.h"
40#include "opt_route.h"
41#include "opt_sctp.h"
42#include "opt_rss.h"
43
44#include <sys/param.h>

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

657 m = m_fragment(m, M_NOWAIT, mbuf_frag_size);
658#endif
659 /*
660 * Reset layer specific mbuf flags
661 * to avoid confusing lower layers.
662 */
663 m_clrprotoflags(m);
664 IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL);
665#ifdef RATELIMIT
666 if (inp != NULL) {
667 if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED)
668 in_pcboutput_txrtlmt(inp, ifp, m);
669 /* stamp send tag on mbuf */
670 m->m_pkthdr.snd_tag = inp->inp_snd_tag;
671 } else {
672 m->m_pkthdr.snd_tag = NULL;
673 }
674#endif
664 error = (*ifp->if_output)(ifp, m,
665 (const struct sockaddr *)gw, ro);
675 error = (*ifp->if_output)(ifp, m,
676 (const struct sockaddr *)gw, ro);
677#ifdef RATELIMIT
678 /* check for route change */
679 if (error == EAGAIN)
680 in_pcboutput_eagain(inp);
681#endif
666 goto done;
667 }
668
669 /* Balk when DF bit is set or the interface didn't support TSO. */
670 if ((ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO)) {
671 error = EMSGSIZE;
672 IPSTAT_INC(ips_cantfrag);
673 goto bad;

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

693 /*
694 * Reset layer specific mbuf flags
695 * to avoid confusing upper layers.
696 */
697 m_clrprotoflags(m);
698
699 IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp,
700 mtod(m, struct ip *), NULL);
682 goto done;
683 }
684
685 /* Balk when DF bit is set or the interface didn't support TSO. */
686 if ((ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO)) {
687 error = EMSGSIZE;
688 IPSTAT_INC(ips_cantfrag);
689 goto bad;

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

709 /*
710 * Reset layer specific mbuf flags
711 * to avoid confusing upper layers.
712 */
713 m_clrprotoflags(m);
714
715 IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp,
716 mtod(m, struct ip *), NULL);
717#ifdef RATELIMIT
718 if (inp != NULL) {
719 if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED)
720 in_pcboutput_txrtlmt(inp, ifp, m);
721 /* stamp send tag on mbuf */
722 m->m_pkthdr.snd_tag = inp->inp_snd_tag;
723 } else {
724 m->m_pkthdr.snd_tag = NULL;
725 }
726#endif
701 error = (*ifp->if_output)(ifp, m,
702 (const struct sockaddr *)gw, ro);
727 error = (*ifp->if_output)(ifp, m,
728 (const struct sockaddr *)gw, ro);
729#ifdef RATELIMIT
730 /* check for route change */
731 if (error == EAGAIN)
732 in_pcboutput_eagain(inp);
733#endif
703 } else
704 m_freem(m);
705 }
706
707 if (error == 0)
708 IPSTAT_INC(ips_fragmented);
709
710done:

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

969 error = 0;
970 break;
971 case SO_SETFIB:
972 INP_WLOCK(inp);
973 inp->inp_inc.inc_fibnum = so->so_fibnum;
974 INP_WUNLOCK(inp);
975 error = 0;
976 break;
734 } else
735 m_freem(m);
736 }
737
738 if (error == 0)
739 IPSTAT_INC(ips_fragmented);
740
741done:

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

1000 error = 0;
1001 break;
1002 case SO_SETFIB:
1003 INP_WLOCK(inp);
1004 inp->inp_inc.inc_fibnum = so->so_fibnum;
1005 INP_WUNLOCK(inp);
1006 error = 0;
1007 break;
1008 case SO_MAX_PACING_RATE:
1009#ifdef RATELIMIT
1010 INP_WLOCK(inp);
1011 inp->inp_flags2 |= INP_RATE_LIMIT_CHANGED;
1012 INP_WUNLOCK(inp);
1013 error = 0;
1014#else
1015 error = EOPNOTSUPP;
1016#endif
1017 break;
977 default:
978 break;
979 }
980 }
981 return (error);
982 }
983
984 switch (sopt->sopt_dir) {

--- 434 unchanged lines hidden ---
1018 default:
1019 break;
1020 }
1021 }
1022 return (error);
1023 }
1024
1025 switch (sopt->sopt_dir) {

--- 434 unchanged lines hidden ---