Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

no-op on bad ames packet mugs #1143

Merged
merged 3 commits into from
Apr 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions sys/vane/ames.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@
::
|%
++ bite :: packet to cake
|= pac=rock ^- cake
|= pac=rock
^- (unit cake)
=+ [mag=(end 5 1 pac) bod=(rsh 5 1 pac)]
=+ :* vez=(end 0 3 mag) :: protocol version
chk=(cut 0 [3 20] mag) :: checksum
wix=(bex +((cut 0 [23 2] mag))) :: width of receiver
vix=(bex +((cut 0 [25 2] mag))) :: width of sender
tay=(cut 0 [27 5] mag) :: message type
==
?> =(protocol-version vez)
?> =(chk (end 0 20 (mug bod)))
:: XX these packets should be firewalled in vere so that they don't
:: make it into the event log
::
?. =(protocol-version vez) ~
?. =(chk (end 0 20 (mug bod))) ~
%- some
:+ [(end 3 wix bod) (cut 3 [wix vix] bod)]
(kins tay)
(rsh 3 (add wix vix) bod)
Expand Down Expand Up @@ -606,19 +611,19 @@
~/ %gnaw
|= [kay=cape ryn=lane pac=rock] :: process packet
^- [p=(list boon) q=fort]
?. =(protocol-version (end 0 3 pac)) [~ fox]
=+ kec=(bite pac)
?: (goop p.p.kec)
=/ kec=(unit cake) (bite pac)
?~ kec [~ fox]
?: (goop p.p.u.kec)
[~ fox]
?. =(our q.p.kec)
?. =(our q.p.u.kec)
[~ fox]
=; zap=[p=(list boon) q=fort]
[(weld p.zap next) q.zap]
=< zork
=< zank
:: ~& [%hear p.p.kec ryn `@p`(mug (shaf %flap pac))]
%- ~(chew la:(ho:um p.p.kec) kay ryn %none (shaf %flap pac))
[q.kec r.kec]
:: ~& [%hear p.p.u.kec ryn `@p`(mug (shaf %flap pac))]
%- ~(chew la:(ho:um p.p.u.kec) kay ryn %none (shaf %flap pac))
[q.u.kec r.u.kec]
::
++ goop :: blacklist
|= him=ship
Expand Down