* Receive data on a hook bypass */
| 860 | * Receive data on a hook bypass |
| 861 | */ |
| 862 | static int |
| 863 | ng_ppp_rcvdata_bypass(hook_p hook, item_p item) |
| 864 | { |
| 865 | uint16_t linkNum; |
| 866 | uint16_t proto; |
| 867 | struct mbuf *m; |
| 868 | |
| 869 | NGI_GET_M(item, m); |
| 870 | if (m->m_pkthdr.len < 4) { |
| 871 | NG_FREE_ITEM(item); |
| 872 | return (EINVAL); |
| 873 | } |
| 874 | if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL) { |
| 875 | NG_FREE_ITEM(item); |
| 876 | return (ENOBUFS); |
| 877 | } |
| 878 | linkNum = be16dec(mtod(m, uint8_t *)); |
| 879 | proto = be16dec(mtod(m, uint8_t *) + 2); |
| 880 | m_adj(m, 4); |
| 881 | NGI_M(item) = m; |
| 882 | |
| 883 | if (linkNum == NG_PPP_BUNDLE_LINKNUM) |
| 884 | return (ng_ppp_hcomp_xmit(NG_HOOK_NODE(hook), item, proto)); |
| 885 | else |
| 886 | return (ng_ppp_link_xmit(NG_HOOK_NODE(hook), item, proto, |
| 887 | linkNum, 0)); |
| 888 | } |
| 889 | |
| 890 | static int |
| 891 | ng_ppp_bypass(node_p node, item_p item, uint16_t proto, uint16_t linkNum) |
nothing calls this directly
no test coverage detected