* Receive data on a hook decrypt. */
| 1286 | * Receive data on a hook decrypt. |
| 1287 | */ |
| 1288 | static int |
| 1289 | ng_ppp_rcvdata_decrypt(hook_p hook, item_p item) |
| 1290 | { |
| 1291 | const node_p node = NG_HOOK_NODE(hook); |
| 1292 | const priv_p priv = NG_NODE_PRIVATE(node); |
| 1293 | uint16_t proto; |
| 1294 | struct mbuf *m; |
| 1295 | |
| 1296 | if (!priv->conf.enableDecryption) { |
| 1297 | NG_FREE_ITEM(item); |
| 1298 | return (ENXIO); |
| 1299 | } |
| 1300 | NGI_GET_M(item, m); |
| 1301 | if ((m = ng_ppp_cutproto(m, &proto)) == NULL) { |
| 1302 | NG_FREE_ITEM(item); |
| 1303 | return (EIO); |
| 1304 | } |
| 1305 | NGI_M(item) = m; |
| 1306 | if (!PROT_VALID(proto)) { |
| 1307 | priv->bundleStats.badProtos++; |
| 1308 | NG_FREE_ITEM(item); |
| 1309 | return (EIO); |
| 1310 | } |
| 1311 | return (ng_ppp_comp_recv(node, item, proto, NG_PPP_BUNDLE_LINKNUM)); |
| 1312 | } |
| 1313 | |
| 1314 | /* |
| 1315 | * Link layer |
nothing calls this directly
no test coverage detected