From b189a249f854dfd2fbfbe13486c8afe20eb4e5e1 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 26 Jul 2017 20:40:54 -0400 Subject: [PATCH] Adjust demo-config.rkt to cope with full domain names --- examples/netstack/incremental-highlevel/demo-config.rkt | 3 ++- examples/netstack/monolithic-lowlevel/demo-config.rkt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/netstack/incremental-highlevel/demo-config.rkt b/examples/netstack/incremental-highlevel/demo-config.rkt index b082398..33365eb 100644 --- a/examples/netstack/incremental-highlevel/demo-config.rkt +++ b/examples/netstack/incremental-highlevel/demo-config.rkt @@ -3,6 +3,7 @@ (require racket/match) (require (only-in mzlib/os gethostname)) +(require (only-in racket/string string-split)) (require "configuration.rkt") (spawn @@ -12,7 +13,7 @@ (assert (gateway-route (bytes 0 0 0 0) 0 (bytes 129 10 115 1) "eth0"))] [other ;; assume a private network (define interface - (match other + (match (car (string-split other ".")) ["skip" "en0"] ["leap" "wlp4s0"] ;; wtf [_ "wlan0"])) diff --git a/examples/netstack/monolithic-lowlevel/demo-config.rkt b/examples/netstack/monolithic-lowlevel/demo-config.rkt index 96296c1..569b550 100644 --- a/examples/netstack/monolithic-lowlevel/demo-config.rkt +++ b/examples/netstack/monolithic-lowlevel/demo-config.rkt @@ -4,6 +4,7 @@ (require racket/match) (require syndicate/monolithic) (require (only-in mzlib/os gethostname)) +(require (only-in racket/string string-split)) (require "configuration.rkt") (provide spawn-demo-config) @@ -17,7 +18,7 @@ (assertion (gateway-route (bytes 0 0 0 0) 0 (bytes 129 10 115 1) "eth0")))] [other ;; assume a private network (define interface - (match other + (match (car (string-split other ".")) ["skip" "en0"] ["leap" "wlp4s0"] ;; wtf [_ "wlan0"]))