lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 23 Apr 2019 11:32:13 +0200
From:   Miroslav Lichvar <mlichvar@...hat.com>
To:     Hangbin Liu <liuhangbin@...il.com>
Cc:     Richard Cochran <richardcochran@...il.com>,
        Jiri Benc <jbenc@...hat.com>, netdev@...r.kernel.org,
        David Miller <davem@...emloft.net>,
        Patrick McHardy <kaber@...sh.net>,
        stefan.sorensen@...ctralink.com
Subject: Re: [PATCH net-next] macvlan: pass get_ts_info and SIOC[SG]HWTSTAMP
 ioctl to real device

On Tue, Apr 23, 2019 at 05:15:43PM +0800, Hangbin Liu wrote:
> On Tue, Apr 23, 2019 at 10:31:41AM +0200, Miroslav Lichvar wrote:
> > V2_L4_SYNC is already selected, only the following filters could be
> > selected on the macvlan interface:
> > 
> > 	HWTSTAMP_FILTER_PTP_V2_L4_SYNC,
> > 	HWTSTAMP_FILTER_PTP_V2_L4_EVENT,
> > 	HWTSTAMP_FILTER_PTP_V2_SYNC,
> > 	HWTSTAMP_FILTER_PTP_V2_EVENT,
> > 	HWTSTAMP_FILTER_ALL,
> > 
> > I think one way to check this would be to assign each filter a
> > (16-bit?) value where the individual bits correspond to the message
> > types and the newly selected filter would have to contain all bits of
> > the old one.
> 
> Just like I said, how to compare with different types.

If those values I described above were in an array called ts_map
indexed by the RX filter enum, I think the check could just be:

	(ts_map[old_filter] & ts_map[new_filter]) == tsmap[old_filter]

The individual bits would correspond to:

PTP_V1_L4_SYNC
PTP_V1_L4_DELAY_REQ
PTP_V2_L4_SYNC
PTP_V2_L4_DELAY_REQ
PTP_V2_L2_SYNC
PTP_V2_L2_DELAY_REQ
NTP_ALL

And the remaining RX filters would be combinations of those.

-- 
Miroslav Lichvar

Powered by blists - more mailing lists