| 471 | } |
| 472 | |
| 473 | static int |
| 474 | AliasHandlePptpGreOut(struct libalias *la, struct ip *pip) |
| 475 | { |
| 476 | GreHdr *gr; |
| 477 | struct alias_link *lnk; |
| 478 | |
| 479 | gr = (GreHdr *) ip_next(pip); |
| 480 | |
| 481 | /* Check GRE header bits. */ |
| 482 | if ((ntohl(*((u_int32_t *) gr)) & PPTP_INIT_MASK) != PPTP_INIT_VALUE) |
| 483 | return (-1); |
| 484 | |
| 485 | lnk = FindPptpOutByPeerCallId(la, pip->ip_src, pip->ip_dst, gr->gh_call_id); |
| 486 | if (lnk != NULL) { |
| 487 | struct in_addr alias_addr = GetAliasAddress(lnk); |
| 488 | |
| 489 | /* Change source IP address. */ |
| 490 | DifferentialChecksum(&pip->ip_sum, |
| 491 | &alias_addr, &pip->ip_src, 2); |
| 492 | pip->ip_src = alias_addr; |
| 493 | } |
| 494 | return (0); |
| 495 | } |
| 496 | |
| 497 | static int |
| 498 | AliasHandlePptpGreIn(struct libalias *la, struct ip *pip) |
no test coverage detected