Bug 201382

Summary: net/dhcprelay: Does not work on big-endian machines
Product: Ports & Packages Reporter: Kristof Provost <kp>
Component: Individual Port(s)Assignee: Thomas Zander <riggs>
Status: Closed FIXED    
Severity: Affects Some People CC: edwin, edwin, koobs, mips, riggs
Priority: --- Keywords: easy, patch, patch-ready
Version: LatestFlags: edwin: maintainer-feedback+
Hardware: mips   
OS: Any   
Attachments:
Description Flags
dhcprelay patch
koobs: maintainer-approval? (edwin)
Cross-build output none

Description Kristof Provost freebsd_committer freebsd_triage 2015-07-06 21:13:45 UTC
Created attachment 158434 [details]
dhcprelay patch

net/dhcprelay doesn't work on big-endian machines.

In pcap_callback() it checks if the received ethernet frame contains an IP packet as follows: "eh->ether_type!=8". That's correct on a little-endian system, but not on a big-endian one.

The attached patch fixes the issue.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2015-07-07 04:44:54 UTC
Thanks Kristof,

Can you attach successful poudriere build output on mips please?
Comment 2 Kristof Provost freebsd_committer freebsd_triage 2015-07-07 08:26:10 UTC
Created attachment 158478 [details]
Cross-build output

Unfortunately I can't easily provide poudriere output. I'm cross-building because my target is a TPLink tl-wdr3600. It's only got 8MB of flash storage.

Here's the cross-build output though.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-07-16 14:52:38 UTC
A commit references this bug:

Author: riggs
Date: Thu Jul 16 14:52:13 UTC 2015
New revision: 392296
URL: https://svnweb.freebsd.org/changeset/ports/392296

Log:
  Fix runtime error: Packet type identification on big-endian
  machines which prevented it from working correctly on e.g.
  MIPS-based routers.

  PR:		201382
  Submitted by:	kp@freebsd.org
  Approved by:	edwin@mavetju.org (maintainer)
  MFH:		2015Q3

Changes:
  head/net/dhcprelay/Makefile
  head/net/dhcprelay/files/patch-Makefile
  head/net/dhcprelay/files/patch-dhcprelay.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2015-07-17 16:09:32 UTC
A commit references this bug:

Author: riggs
Date: Fri Jul 17 16:09:20 UTC 2015
New revision: 392384
URL: https://svnweb.freebsd.org/changeset/ports/392384

Log:
  MFH: r392296

  Fix runtime error: Packet type identification on big-endian
  machines which prevented it from working correctly on e.g.
  MIPS-based routers.

  PR:		201382
  Submitted by:	kp@freebsd.org
  Approved by:	ports-secteam (feld), edwin@mavetju.org (maintainer)

Changes:
_U  branches/2015Q3/
  branches/2015Q3/net/dhcprelay/Makefile
  branches/2015Q3/net/dhcprelay/files/patch-Makefile
  branches/2015Q3/net/dhcprelay/files/patch-dhcprelay.c