Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # cat if_ethersubr.c.patch
- *** if_ethersubr.c Fri Jan 13 09:52:49 2012
- --- if_ethersubr.c_ Sun Oct 30 19:40:28 2011
- ***************
- *** 622,627 ****
- --- 622,633 ----
- ifp->if_imcasts++;
- }
- + m->m_flags |= M_FLOWID;
- + m->m_pkthdr.flowid = eh->ether_dhost[0] + eh->ether_dhost[1] + eh->ether_dhost[2] + eh->ether_dhost[3] + eh->ether_dhost[4] + eh->ether_dhost[5];
- + m->m_pkthdr.flowid += eh->ether_shost[0] + eh->ether_shost[1] + eh->ether_shost[2] + eh->ether_shost[3] + eh->ether_shost[4] + eh->ether_shost[5];
- +
- +
- +
- #ifdef MAC
- /*
- * Tag the mbuf with an appropriate MAC label before any other
- ***************
- *** 873,878 ****
- --- 879,908 ----
- if ((m = ip_fastforward(m)) == NULL)
- return;
- isr = NETISR_IP;
- +
- + struct ipheader {
- + u_char offset [12]; //ip header fields not actually needed here
- + u_char src [4]; //ip src
- + u_char dst [4]; //ip dst
- + } __packed __aligned(4);
- +
- + if (m->m_pkthdr.len < sizeof(struct ipheader)) { //from ip_fastforward
- + if_printf(ifp, "flowid math: discard frame with too small header\n");
- + goto discard;
- + }
- + if (m->m_len < sizeof (struct ipheader) &&
- + (m = m_pullup(m, sizeof (struct ipheader))) == NULL) { //ip_fastforward
- + if_printf(ifp, "flowid math: discard frame at pullup\n");
- + return; /* mbuf already free'd */
- + }
- + struct ipheader *ip;
- + ip = mtod(m, struct ipheader *);
- + m->m_pkthdr.flowid += ip->src[0] + ip->src[1] + ip->src[2] + ip->src[3];
- + m->m_pkthdr.flowid += ip->dst[0] + ip->dst[1] + ip->dst[2] + ip->dst[3];
- +
- + //if_printf(ifp, "Calculated flow id %d\n", m->m_pkthdr.flowid);
- +
- +
- break;
- case ETHERTYPE_ARP:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement